package com.xhai.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 操作日志表
 * </p>
 *
 * @author xhai
 * @since 2025-05-24
 */
@Getter
@Setter
@ToString
@TableName("sys_oper_log")
@Schema(name = "SysOperLog", description = "操作日志表")
public class SysOperLog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 操作日志ID
     */
    @Schema(description = "操作日志ID")
    @TableId(value = "OPER_LOG_ID", type = IdType.ASSIGN_ID)
    private Long operLogId;

    /**
     * 应用名
     */
    @Schema(description = "应用名")
    @TableField("APPLICATION_NAME")
    private String applicationName;

    /**
     * 类名
     */
    @TableField("CLASS_NAME")
    @Schema(description = "类名")
    private String className;

    /**
     * 方法名
     */
    @TableField("METHOD_NAME")
    @Schema(description = "方法名")
    private String methodName;

    /**
     * 方法参数
     */
    @TableField("PARAMS")
    @Schema(description = "方法参数")
    private String params;

    /**
     * 请求方式
     */
    @Schema(description = "请求方式")
    @TableField("REQUEST_METHOD")
    private String requestMethod;

    /**
     * 请求路径
     */
    @TableField("REQUEST_URL")
    @Schema(description = "请求路径")
    private String requestUrl;

    /**
     * 请求IP地址
     */
    @TableField("REQUEST_IP")
    @Schema(description = "请求IP地址")
    private String requestIp;

    /**
     * 服务器地址
     */
    @TableField("SERVER_IP")
    @Schema(description = "服务器地址")
    private String serverIp;

    /**
     * 登录地点
     */
    @TableField("LOCATION")
    @Schema(description = "登录地点")
    private String location;

    /**
     * 操作时间
     */
    @TableField("OPER_TIME")
    @Schema(description = "操作时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime operTime;

    /**
     * 操作用户
     */
    @TableField("OPER_USERNAME")
    @Schema(description = "操作用户")
    private String operUsername;

    /**
     * 操作用户部门
     */
    @TableField("OPER_DEPT_NAME")
    @Schema(description = "操作用户部门")
    private String operDeptName;

    /**
     * 操作结果（0失败，1成功）
     */
    @TableField("OPER_RESULT")
    @Schema(description = "操作结果（0失败，1成功）")
    private String operResult;

    /**
     * 操作提示消息
     */
    @TableField("OPER_MSG")
    @Schema(description = "操作提示消息")
    private String operMsg;

    /**
     * 操作花费时间（秒）
     */
    @TableField("OPER_COST_TIME")
    @Schema(description = "操作花费时间（秒）")
    private Integer operCostTime;
}
